import { h } from 'vue'

import useDictionaryStore from '~stores/module/dictionary'
const { articleStatus } = useDictionaryStore()

export const articleConfig = {
  headList: [
    {
      label: '标题',
      prop: 'title'
    },
    {
      label: '内容',
      prop: 'content'
    },
    {
      label: '创建时间',
      prop: 'created_at'
    },
    {
      label: '状态',
      prop: 'status',
      slot: true,
      render: (row) => {
        return h(
          'el-tag',
          {
            class: row.status === 1
              ? 'el-tag el-tag--success el-tag--light'
              : 'el-tag el-tag--danger el-tag--light'
          },
          articleStatus[row.status]
        )
      }
    }
  ]
}
